package com.dhcc.sds.busi.service;

import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.dhcc.cdc.busi.entity.CdcEpisodeEntity;
import com.dhcc.core.framework.base.service.IBaseService;
import com.dhcc.sds.base.entity.SdsQcentityEntity;
import com.dhcc.sds.busi.dto.AnalysisIndexDto;
import com.dhcc.sds.busi.dto.STEMIIndexStaDto;
import com.dhcc.sds.busi.entity.SdsQcincaseEntity;
import com.dhcc.sds.busi.vo.AnalysisSdsPortalVo;
import com.dhcc.sds.busi.vo.SdsOPQcincaseVo;

/**
 * 病种入组病例表数据服务层接口
 * 
 * @ClassName: ISdsQcincaseService
 * @Description: TODO
 * @author sunyingjie
 * @date 2021-03-22 10:09:15
 */
public interface ISdsQcincaseService  extends IBaseService<SdsQcincaseEntity> {
	
    List<SdsQcincaseEntity> page(Page<SdsQcincaseEntity> page,Map<String, Object> map);
    List<SdsQcincaseEntity> list(Map<String, Object> map);

    /**
     * 根据入院时间或出院时间查询报告
     * @param params
     * @return
     */
    List<SdsQcincaseEntity> listByDate(Map<String, Object> params, String dateType, String startDate, String endDate);

    /**
     * 根据字典类型查询字典数据
     * @param type
     * @return
     */
    JSONObject getStatusMapByType(String type);

    void deleteStatusById(Long sdsQcincaseId);

    /**
     * 根据就诊id判断该病人是否入组，入组返回入组id
     * * @param episodeId
     * @return
     */
    Long isGroup(Long episodeId);
    /**
     * 查询病种的日期范围（年）
     */
    JSONArray getYearMap();
    /**
     * 查询病种的日期范围（月）
     */
    JSONArray getMonthMap();

    List<STEMIIndexStaDto> getIndexDatas(Map<String, Object> params);

    List<Long> getIndexNums(Map<String, Object> params);

    SdsQcincaseEntity selectByEpisodeId(Map<String, Object> params);

    SdsQcincaseEntity selectEntityByEpisodeId(Long episodeId);

    SdsQcincaseEntity selectByEpisodeIdAndEntityId(Long episodeId, Long entityId);

    List<AnalysisIndexDto> getAnalysisIndexDatas(Map<String, Object> params);

    Map<String, Object> listByDate2(Map<String, Object> params);

    List<SdsQcincaseEntity> page2(Page<SdsQcincaseEntity> page, Map<String, Object> params);

    List<Integer> selectPortalCount(Map<String, Object> params);

    List<AnalysisSdsPortalVo> selectPortalMrlist(Map<String, Object> params);

    List<Long> selectEntity();

    AnalysisSdsPortalVo selectCostsAndDays(Long entityId, Map<String, Object> params);

    List<AnalysisSdsPortalVo> selectARatioChartData(Map<String, Object> params);

    List<AnalysisSdsPortalVo> selectByStatus(Long entityId, List<String> status, Map<String, Object> params);

    List<AnalysisSdsPortalVo> selectMrInfoByIDs(List<Long> incaseIds);

    List<AnalysisSdsPortalVo> selectPortalCountDetails(String formCheckType, String idName, List<String> deptIds);

    List<AnalysisSdsPortalVo> selectByCondition(Map<String, Object> params, List<String> statusList);

    List<AnalysisSdsPortalVo> selectCostsAndDaysByDate(Map<String, Object> params);

    List<AnalysisSdsPortalVo> getIndexDataByDate(Map<String, Object> params);

    List<AnalysisSdsPortalVo> selectPortalCountDetailsList(String formCheckType, String idName, List<String> deptIds);

    List<AnalysisSdsPortalVo> selectByConditionList(Map<String, Object> params, List<String> statusList);

    List<AnalysisSdsPortalVo> getIndexListDataByDate(Map<String, Object> params);

    CdcEpisodeEntity selectEpisodeByIncaseId(Long parseLong);

    List<Long> selectIncaseIdsByCondition(Map<String, Object> params, List<String> statusList);

    List<SdsOPQcincaseVo> selectOPIncaseByCondition(Map<String, Object> params);

    List<SdsOPQcincaseVo> selectOPIncaseByRegNo(List<Long> incaseIds);

    List<SdsQcincaseEntity> selectMrList(Map<String, Object> params);

    String getAutoAlias(Long mrId);

    Long getMrUseTime(Long mrId);

    List<SdsQcincaseEntity> selectOPByDimData(Long dimDataId, Long admTypeId);

    Long getEntityIdByEpisodeId(Long episodeId);

    List<SdsQcincaseEntity> selectContraindicationByAdmStatus(Long id);
    String selectUploadStateByEpisodeId(Map map);

    List<SdsQcincaseEntity> getDelayReport(Page<SdsQcincaseEntity> page,Map<String, Object> params);

    /**
     * @param params
     * @return
     * @Description: 获取患者出院入组和在院入组情况
     * @Title: getMrlistInfo
     * @author: sunyingjie
     * @date: 2022年12月13日15:02:22
     */
    JSONObject getMrListInfo(Map<String, Object> params);
    /**
     * @param params
     * @return
     * @Description: 变更入组病种（保留当前入组记录）
     * @Title: changeMrEntity
     * @author: sunyingjie
     * @date: 2022年12月14日10:24:52
     */
    void changeMrEntity(Map<String, Object> params);
}
